﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Windows.Forms;
using VietKinsNutrition.Data;
using DevExpress.XtraGrid.Views.Grid;

namespace VietKinsNutrition.Bussiness
{
    public class ClsTblChitietkienthucnoitroBLL : ClsBindingBLL
    {
        ClsTblChitietkienthucnoitroDAL ClsTblChitietkienthucnoitrodal = new ClsTblChitietkienthucnoitroDAL();
        //ClearControl(this.tenkenhTextBox);
        public void ClearControl(TextBox Tieude, TextBox Noidung)
        {
            Tieude.Text = Noidung.Text = "";
        }
        public void FocusControl(TextBox Tieude)
        {
            Tieude.Focus();
        }
        //TblChitietkienthucnoitro_GetByLoaikienthucnoitroId
        public DataTable GetByNhomkienthucIdandName(int LoaikienthucnoitroId, string Tieude)
        {
            return ClsTblChitietkienthucnoitrodal.GetByNhomkienthucIdandName(LoaikienthucnoitroId, Tieude);
        }
        public DataTable GetByName(string Tieude)
        {
            return ClsTblChitietkienthucnoitrodal.GetByName(Tieude);
        }
        public void Bind_Grid(int LoaikienthucnoitroId, GridView Grid)
        {
            Grid.GridControl.DataSource = ClsTblChitietkienthucnoitrodal.TblChitietkienthucnoitro_GetByLoaikienthucnoitroId(LoaikienthucnoitroId);
        }
        public DataTable SelectAllById(int Id)
        {
            return ClsTblChitietkienthucnoitrodal.SelectAllById(Id);
        }
        public DataTable SelectAll()
        {
            return ClsTblChitietkienthucnoitrodal.SelectAll();
        }
        public void Insert(int LoaikienthucnoitroId, string Tieude, string Noidung)
        {
            ClsTblChitietkienthucnoitrodal.Insert(LoaikienthucnoitroId, Tieude, Noidung);
        }
        public void Delete(int Id)
        {
            ClsTblChitietkienthucnoitrodal.Delete(Id);
        }
        public void Edit(int Id, string Tieude, string Noidung)
        {
            ClsTblChitietkienthucnoitrodal.Edit(Id, Tieude, Noidung);
        }
    }
}
